home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / demos / r-z / stormc-demo / include / stream.h < prev    next >
C/C++ Source or Header  |  1996-01-09  |  3KB  |  122 lines

  1. #ifndef _INCLUDE_STREAM_H
  2. #define _INCLUDE_STREAM_H
  3.  
  4. /*
  5. **  $VER: stream.h 10.1 (19.7.95)
  6. **  Includes Release 40.15
  7. **
  8. **  '(C) Copyright 1995 Haage & Partner Computer GmbH'
  9. **     All Rights Reserved
  10. */
  11.  
  12. #ifndef __cplusplus
  13. #error <stream.h> must be compiled in C++ mode.
  14. #pragma +
  15. #endif
  16.  
  17. #ifndef EOF
  18. #define EOF (-1)
  19. #endif
  20.  
  21. struct stream;
  22.  
  23. typedef stream FILE;
  24.  
  25. class form
  26. {  struct tmpstr
  27.    { tmpstr *link;
  28.      char *dynamicstr;
  29.    } *string;
  30.   public:
  31.    form(const char*, ...);
  32.    ~form();
  33. };
  34.  
  35. class ios
  36. { protected:
  37.     FILE *file;
  38.     unsigned char basefield;
  39.     unsigned char GUESS, WHAT, FOR;
  40.   public:
  41.     ios(FILE *f=0);
  42.     FILE *getstream();
  43.     operator void*();
  44.  
  45.     enum open_mode { in=1, out=2, app=4 };
  46.     enum seek_dir { beg=-1, cur=0, end=1 };
  47. };
  48.  
  49. ios &flush(ios&);
  50. ios &endl(ios&);
  51. ios &dec(ios&);
  52. ios &hex(ios&);
  53. ios &oct(ios&);
  54.  
  55. class ostream: public virtual ios
  56. { protected:
  57.     unsigned char Reserved;
  58.   public:
  59.     ostream(FILE *f=0);
  60.     ostream &operator << (int);
  61.     ostream &operator << (unsigned);
  62.     ostream &operator << (long);
  63.     ostream &operator << (unsigned long);
  64.     ostream &operator << (long long);
  65.     ostream &operator << (unsigned long long);
  66.     ostream &operator << (char);
  67.     ostream &operator << (unsigned char);
  68.     ostream &operator << (signed char);
  69.     ostream &operator << (const char *);
  70.     ostream &operator << (float);
  71.     ostream &operator << (double);
  72.     ostream &operator << (long double);
  73.     ostream &operator << (form &);
  74.     ostream &operator << (const void*);
  75.     ostream &operator << (ios&(*f)(ios&));
  76.     ostream &put(char);
  77.     ostream &write(const char*, int);
  78. };
  79.  
  80. class istream : public virtual ios
  81. { protected:
  82.     unsigned char errorflag;
  83.   public:
  84.     istream(FILE *f=0);
  85.     istream &operator >> (char *);
  86.     istream &operator >> (unsigned char *);
  87.     istream &operator >> (char&);
  88.     istream &operator >> (unsigned char&);
  89.     istream &operator >> (signed char&);
  90.     istream &operator >> (short&);
  91.     istream &operator >> (unsigned short&);
  92.     istream &operator >> (int&);
  93.     istream &operator >> (unsigned &);
  94.     istream &operator >> (long&);
  95.     istream &operator >> (unsigned long&);
  96.     istream &operator >> (long long&);
  97.     istream &operator >> (unsigned long long&);
  98.     istream &operator >> (float&);
  99.     istream &operator >> (double&);
  100.     istream &operator >> (long double&);
  101.     istream &read(char *,int);
  102.     istream &get(char &);
  103.     istream &get(unsigned char &);
  104.     int      get();
  105.     istream &getline(char *buf, int len, char Delim = '\n');
  106.     istream &putback(char);
  107.     int eof();
  108.     operator void*();
  109. };
  110.  
  111. #define STREAM_MAXSTRING 80
  112.  
  113. extern ostream cout, cerr, clog;
  114. extern istream cin;
  115.  
  116. extern "C" {
  117. void exit(int);
  118. }
  119.  
  120. #endif
  121.  
  122.